package im.ok.back.controller;

import im.ok.back.common.ServerResponse;
import im.ok.back.service.ITextService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("text")
public class TextController {

    @Autowired
    private ITextService iTextService;

    @PostMapping("morseEncode")
    public ServerResponse morseEncode(String text) {
        return iTextService.morseEncode(text);
    }

    @PostMapping("morseDecode")
    public ServerResponse morseDecode(String morseText) {
        return iTextService.morseDecode(morseText);
    }
}
